package com.rmdc.simop.commons.model.service;

import java.util.List;

import com.rmdc.simop.commons.exception.GeneralException;

/**
 * @author Carlos Ruiz
 *
 * @param <Entity>
 */
public interface BaseService<Entity> {
	
	/**
	 * @param codigo
	 * @return Entity
	 * @throws GeneralException
	 */
	public Entity readByCodigo(String codigo) throws GeneralException;

	/**
	 * @param id
	 * @return Entity
	 * @throws GeneralException
	 */
	public Entity readById(Integer id) throws GeneralException;

	/**
	 * @param nombre
	 * @return List<Entity>
	 * @throws GeneralException
	 */

	public List<Entity> findByCodigo(String codigo) throws GeneralException;

	/**
	 * @param valor
	 * @param nombrePropiedad
	 * @return List<Entity>
	 * @throws GeneralException
	 */
	public List<Entity> findByPropiedad(String valor, String nombrePropiedad)
			throws GeneralException;

	/**
	 * @param object
	 * @throws GeneralException
	 */
	public void update(Entity object) throws GeneralException;

	/**
	 * @param object
	 * @throws GeneralException
	 */
	public void create(Entity object) throws GeneralException;

	/**
	 * @param object
	 * @throws GeneralException
	 */
	public void delete(Entity object) throws GeneralException;

	/**
	 * @param id
	 * @throws GeneralException
	 */
	public void deleteById(Integer id) throws GeneralException;

	/**
	 * @param codigo
	 * @throws GeneralException
	 */
	public void deleteByCodigo(String codigo) throws GeneralException;

	/**
	 * @return List<Entity>
	 * @throws GeneralException
	 */
	public List<Entity> findAll() throws GeneralException;
}
